﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.gskinner.motion.easing {

    public class Elastic {

        protected static var a:Number = 1;
        protected static var p:Number = 0.3;
        protected static var s:Number = (p / 4);

        public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
            if ((((_arg1 == 0)) || ((_arg1 == 1)))){
                return (_arg1);
            };
            --_arg1;
            return (-(((a * Math.pow(2, (10 * _arg1))) * Math.sin((((_arg1 - s) * (2 * Math.PI)) / p)))));
        }
        public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
            if ((((_arg1 == 0)) || ((_arg1 == 1)))){
                return (_arg1);
            };
            return ((((a * Math.pow(2, (-10 * _arg1))) * Math.sin((((_arg1 - s) * (2 * Math.PI)) / p))) + 1));
        }
        public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
            if ((((_arg1 == 0)) || ((_arg1 == 1)))){
                return (_arg1);
            };
            _arg1 = ((_arg1 * 2) - 1);
            if (_arg1 < 0){
                return ((-0.5 * ((a * Math.pow(2, (10 * _arg1))) * Math.sin((((_arg1 - (s * 1.5)) * (2 * Math.PI)) / (p * 1.5))))));
            };
            return (((((0.5 * a) * Math.pow(2, (-10 * _arg1))) * Math.sin((((_arg1 - (s * 1.5)) * (2 * Math.PI)) / (p * 1.5)))) + 1));
        }

    }
}//package com.gskinner.motion.easing 
